import 'dart:ui';

import 'package:flutter/material.dart';
import 'res/listData.dart';


class ChangeTextColor extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("有点f麻烦"),
        ),
        body: HomePage(),
      ),
    );
  }
}

// 自定有状态组件
class HomePage extends StatefulWidget {
  HomePage({Key key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  int num = 0;
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
          Chip(
            label: Text("${this.num}"),
          ),
          SizedBox(height: 20),
          RaisedButton(
            child: Text('按钮'),
            onPressed: () {
              setState(() {
                this.num++;
              });
            },
          )
        ],
      ),
    );
  }
}
